#Copyright 2003, Cypress Semiconductor Corporation

#*****************************************************************************#

#This software is owned by Cypress Semiconductor Corporation (Cypress) and is

#protected by United States copyright laws and international treaty provisions.

#Cypress hereby grants to Licensee a personal, non-exclusive, non-transferable 

#license to copy, use, modify, create derivative works of, and compile the 

#Cypress Source Code and derivative works for the sole purpose of creating 

#custom software in support of Licensee product ("Licensee Product") to be 

#used only in conjunction with a Cypress integrated circuit. Any reproduction, 

#modification, translation, compilation, or representation of this software 

#except as specified above is prohibited without the express written permission

#of Cypress.





#Disclaimer: Cypress makes no warranty of any kind, express or implied, with 

#regard to this material, including, but not limited to, the implied warranties

#of merchantability and fitness for a particular purpose. Cypress reserves the 

#right to make changes without further notice to the materials described 

#herein. Cypress does not assume any liability arising out of the application 

#or use of any product or circuit described herein. Cypress products described

# herein are not authorized for use as components in life-support devices.

#This software is protected by and subject to worldwide patent coverage, 

#including U.S. and foreign patents. Use may be limited by and subject to 

#the Cypress Software License Agreement.

#*****************************************************************************#



#Source File Information Header Template

# *******************************************************************

# File : 

# Author :Prokash Ghosh 

# Author s Email:pbg@cypress.com

# Date : 30 AUG,03 

# Revision : 1.1  

# *******************************************************************

# Descriptiosn : This script provides  options to select the different simulators

# and depending on the selected option, it call other script to perform the simulation. 

# (Add succinct functionality description here.)

#

# *******************************************************************

#!/bin/csh -f

##############################################################################

# Cypress Semiconductor Confidential. Copyright 2001, All Rights reserved    #

# Permission to use, modify or copy this code is prohibited without the      #

# express written consent of Cypress Semiconductor.                          #

# 110 Nortech Parkway, San Jose, CA 95134                                    #

#                                                                            #

# Author: pbg@cypress.com                                                    #

# $Date: 28/05/03 #							     #

# $Revision: 1.0 $ #							     #

##############################################################################

cd  ../../Verilog/run/

\rm -rf run_default

\rm -rf cmd

cd  ../../VHDL/run/

\rm -rf cmd

\rm -rf run_default

cd  ../../Verilog/run/

##

   echo "     "

   echo "  "

   echo "Independent Clock Quad Hotlink-II Behavioral Model(Verilog/VHDL) Simulation Enviornment"

   echo "1. Verilog Model(Default)  "

   echo "2. VHDL Model              "

   echo "Enter an Option:"

   set response = $<

   if ("$response" == "2") then

	goto vhdl_sim      

   else 

        goto verilog_sim

   endif

   



verilog_sim:

	echo " Choose a Verilog Simulator : "

	echo " 1. Verilog-XL (Default) "

	echo " 2. NC-Verilog 		"

	echo " 3. ModelSim		"

        echo "Enter an Option:"

	set response = $< 

	if ("$response" == "2") then

        goto vlog_ncv

	else if (("$response" == "3")) then

        goto vlog_modelsim

	else

        goto  vlog_xl

        endif





vhdl_sim:

	

	echo " Choose a VHDL Simulator : "

        echo " 1. NC-VHDL(Default)      "

        echo " 2. ModelSim              "

        echo "Enter an Option:"

        set response = $<

        if ("$response" == "2") then

        goto vhdl_modelsim

        else

        goto ncvhdl_sim 

        endif



vlog_xl:



	echo " Which testbench you want to run: "

	echo " 1. TX-BIST(default) "

	echo " 2. TX-ENCODER ENABLED "

	echo " 3. TX-ENCODER DISABLED "

	echo " 4. RX-BIST "

	echo " 5. RX-MODE "

	echo " 6. TX-RX LOOP BACK MODE "

	echo " 7. USER CONFIGURABLE TEST BENCH  "

	echo " 8. RUN all modes in the above sequence " 

        echo "Enter an Option:"

        set response_vxl = $<

        if("$response_vxl" == "8") then 

	echo " Do you want the VCD file for all simulations (Y/N) : Default is No"

        set response_dump = $<

	else set response_dump = ""

        endif

        if(("$response_vxl" == "2")) then

        ./run_vxl cyp15g0403dxb_tx_ee_tb_all.v $response_vxl 

        else if(("$response_vxl" == "3")) then

        ./run_vxl cyp15g0403dxb_tx_ed_tb_all.v $response_vxl

	else if(("$response_vxl" == "4")) then

        ./run_vxl cyp15g0403dxb_rx_bist_tb_all.v $response_vxl

        else if(("$response_vxl" == "5")) then	

	./run_vxl cyp15g0403dxb_rx_tb_all.v $response_vxl

	else if(("$response_vxl" == "6")) then

	 ./run_vxl cyp15g0403dxb_tx_rx_loopback_tb_all.v $response_vxl

	else if(("$response_vxl" == "7")) then

	 ./run_vxl cyp15g0403dxb_user_config_tb_all.v $response_vxl

        else if(("$response_vxl" == "8")) then

	echo " RUNNING TX-BIST "

	./run_vxl cyp15g0403dxb_tx_bist_tb_all.v $response_vxl $response_dump

	echo " RUNNING TX-ENCODER ENABLED "

	./run_vxl cyp15g0403dxb_tx_ee_tb_all.v $response_vxl $response_dump

	echo " RUNNING TX-ENCODER DISABLED "

	./run_vxl cyp15g0403dxb_tx_ed_tb_all.v $response_vxl $response_dump

	echo " RUNNING RX-BIST "

	./run_vxl cyp15g0403dxb_rx_bist_tb_all.v $response_vxl $response_dump

	echo " RUNNING RX-MODE "

	./run_vxl cyp15g0403dxb_rx_tb_all.v $response_vxl $response_dump

	echo " RUNNING TX-RX LOOP BACK MODE "

	./run_vxl cyp15g0403dxb_tx_rx_loopback_tb_all.v $response_vxl $response_dump

	echo " RUNNING USER CONFIGURABLE TEST BENCH  "

	./run_vxl cyp15g0403dxb_user_config_tb_all.v $response_vxl $response_dump

        else 

        # run the simulation script.

	./run_vxl cyp15g0403dxb_tx_bist_tb_all.v  $response_vxl 

        endif # testbench options if 

	echo " BYE! "

	endif

	exit



	

vlog_ncv:

	echo " Which testbench you want to run: "

        echo " 1. TX-BIST(default) "

        echo " 2. TX-ENCODER ENABLED "

        echo " 3. TX-ENCODER DISABLED "

        echo " 4. RX-BIST "

        echo " 5. RX-MODE "

        echo " 6. TX-RX LOOP BACK MODE "

	echo " 7. USER CONFIGURABLE TEST BENCH  "

        echo " 8. RUN all modes in the above sequence "

        echo "Enter an Option:"

        set response_ncv = $<

        if("$response_ncv" == "8") then 

	echo " Do you want the VCD file for all simulations (Y/N) : Default is No"

        set response_dump = $<

        else set response_dump = ""

        endif

        if("$response_ncv" == "2") then

        ./run_ncv cyp15g0403dxb_tx_ee_tb_all.v 

        else if(("$response_ncv" == "3")) then

        ./run_ncv cyp15g0403dxb_tx_ed_tb_all.v 

        else if(("$response_ncv" == "4")) then

        ./run_ncv cyp15g0403dxb_rx_bist_tb_all.v 

        else if(("$response_ncv" == "5")) then

        ./run_ncv cyp15g0403dxb_rx_tb_all.v 

        else if(("$response_ncv" == "6")) then

         ./run_ncv cyp15g0403dxb_tx_rx_loopback_tb_all.v

        else if(("$response_ncv" == "7")) then

         ./run_ncv cyp15g0403dxb_user_config_tb_all.v

        else if(("$response_ncv" == "8")) then

        echo " RUNNING TX-BIST "

        ./run_ncv cyp15g0403dxb_tx_bist_tb_all.v $response_ncv $response_dump

        echo " RUNNING TX-ENCODER ENABLED "

        ./run_ncv cyp15g0403dxb_tx_ee_tb_all.v $response_ncv $response_dump

        echo " RUNNING TX-ENCODER DISABLED "

        ./run_ncv cyp15g0403dxb_tx_ed_tb_all.v $response_ncv $response_dump

        echo " RUNNING RX-BIST "

        ./run_ncv cyp15g0403dxb_rx_bist_tb_all.v $response_ncv $response_dump

        echo " RUNNING RX-MODE "

        ./run_ncv cyp15g0403dxb_rx_tb_all.v $response_ncv $response_dump

        echo " RUNNING TX-RX LOOP BACK MODE "

        ./run_ncv cyp15g0403dxb_tx_rx_loopback_tb_all.v $response_ncv $response_dump

        echo " RUNNING USER CONFIGURABLE TEST BENCH "

        ./run_ncv cyp15g0403dxb_user_config_tb_all.v $response_ncv $response_dump

	else 

        ./run_ncv cyp15g0403dxb_tx_bist_tb_all.v 

        endif # testbench options if

        echo " BYE! "

        endif

	exit





vlog_modelsim:

	echo " Which testbench you want to run: "

        echo " 1. TX-BIST(default) "

        echo " 2. TX-ENCODER ENABLED "

        echo " 3. TX-ENCODER DISABLED "

        echo " 4. RX-BIST "

        echo " 5. RX-MODE "

        echo " 6. TX-RX LOOP BACK MODE "

        echo " 7. USER CONFIGURABLE TEST BENCH "

        echo " 8. RUN all modes in the above sequence "

        echo "Enter an Option:"

        set resp_mod_vlog = $<

        if("$resp_mod_vlog" == "8") then 

	echo " Do you want the VCD file for all simulations (Y/N) : Default is No"

        set response_dump = $<

        else set response_dump = ""

        endif

 	###########Start Simulation ##################################

        if(("$resp_mod_vlog" == "2")) then

        ./run_modelsim_verilog cyp15g0403dxb_tx_ee_tb_all.v

        else if(("$resp_mod_vlog" == "3")) then

        ./run_modelsim_verilog cyp15g0403dxb_tx_ed_tb_all.v

        else if(("$resp_mod_vlog" == "4")) then

        ./run_modelsim_verilog cyp15g0403dxb_rx_bist_tb_all.v

        else if(("$resp_mod_vlog" == "5")) then

        ./run_modelsim_verilog cyp15g0403dxb_rx_tb_all.v

        else if(("$resp_mod_vlog" == "6")) then

         ./run_modelsim_verilog cyp15g0403dxb_tx_rx_loopback_tb_all.v

        else if(("$resp_mod_vlog" == "7")) then

         ./run_modelsim_verilog cyp15g0403dxb_user_config_tb_all.v

        else if(("$resp_mod_vlog" == "8")) then

        echo " RUNNING TX-BIST "

        ./run_modelsim_verilog cyp15g0403dxb_tx_bist_tb_all.v $resp_mod_vlog $response_dump

        echo " RUNNING TX-ENCODER ENABLED "

        ./run_modelsim_verilog cyp15g0403dxb_tx_ee_tb_all.v $resp_mod_vlog $response_dump

        echo " RUNNING TX-ENCODER DISABLED "

        ./run_modelsim_verilog cyp15g0403dxb_tx_ed_tb_all.v $resp_mod_vlog $response_dump

        echo " RUNNING RX-BIST "

        ./run_modelsim_verilog cyp15g0403dxb_rx_bist_tb_all.v $resp_mod_vlog $response_dump

        echo " RUNNING RX-MODE "

        ./run_modelsim_verilog cyp15g0403dxb_rx_tb_all.v $resp_mod_vlog $response_dump

        echo " RUNNING TX-RX LOOP BACK MODE "

        ./run_modelsim_verilog cyp15g0403dxb_tx_rx_loopback_tb_all.v $resp_mod_vlog $response_dump

	echo " USER CONFIGURABLE TEST BENCH " 

         ./run_modelsim_verilog cyp15g0403dxb_user_config_tb_all.v

        else

	./run_modelsim_verilog cyp15g0403dxb_tx_bist_tb_all.v

        endif # testbench options if

        echo " BYE! "

        endif

	exit



ncvhdl_sim:

	echo " Which testbench you want to run: "

        echo " 1. TX-BIST(default) "

        echo " 2. TX-ENCODER ENABLED "

        echo " 3. TX-ENCODER DISABLED "

        echo " 4. RX-BIST "

        echo " 5. RX-MODE "

        echo " 6. TX-RX LOOP BACK MODE "

        echo " 7. USER CONFIGURABLE TEST BENCH "

        echo " 8. RUN all modes in the above sequence "

        echo "Enter an Option:"

        set response_ncvhdl = $<

        if("$response_ncvhdl" == "8") then 

	echo " Do you want the VCD file for all simulations (Y/N) : Default is No"

        set response_dump = $<

        else set response_dump = ""

        endif



        if(("$response_ncvhdl" == "2")) then

        ./run_ncvhdl cyp15g0403dxb_tx_ee_tb_all.vhd

        else if(("$response_ncvhdl" == "3")) then

        ./run_ncvhdl cyp15g0403dxb_tx_ed_tb_all.vhd

        else if(("$response_ncvhdl" == "4")) then

        ./run_ncvhdl cyp15g0403dxb_rx_bist_tb_all.vhd

        else if(("$response_ncvhdl" == "5")) then

        ./run_ncvhdl cyp15g0403dxb_rx_tb_all.vhd

        else if(("$response_ncvhdl" == "6")) then

         ./run_ncvhdl cyp15g0403dxb_tx_rx_loopback_tb_all.vhd

        else if(("$response_ncvhdl" == "7")) then

         ./run_ncvhdl cyp15g0403dxb_user_config_tb_all.vhd

        else if(("$response_ncvhdl" == "8")) then

        echo " RUNNING TX-BIST "

        ./run_ncvhdl cyp15g0403dxb_tx_bist_tb_all.vhd $response_ncvhdl $response_dump

        echo " RUNNING TX-ENCODER ENABLED "

        ./run_ncvhdl cyp15g0403dxb_tx_ee_tb_all.vhd $response_ncvhdl $response_dump

        echo " RUNNING TX-ENCODER DISABLED "

        ./run_ncvhdl cyp15g0403dxb_tx_ed_tb_all.vhd $response_ncvhdl $response_dump

        echo " RUNNING RX-BIST "

        ./run_ncvhdl cyp15g0403dxb_rx_bist_tb_all.vhd $response_ncvhdl $response_dump

        echo " RUNNING RX-MODE "

        ./run_ncvhdl cyp15g0403dxb_rx_tb_all.vhd $response_ncvhdl $response_dump

        echo " RUNNING TX-RX LOOP BACK MODE "

        ./run_ncvhdl cyp15g0403dxb_tx_rx_loopback_tb_all.vhd $response_ncvhdl $response_dump

        echo " RUNNING USER CONFIGURABLE TEST BENCH "

        ./run_ncvhdl cyp15g0403dxb_user_config_tb_all.vhd $response_ncvhdl $response_dump

        else 

	./run_ncvhdl cyp15g0403dxb_tx_bist_tb_all.vhd

        endif # testbench options if

        echo " BYE! "

        endif

	exit



vhdl_modelsim:	

	echo " Which testbench you want to run: "

        echo " 1. TX-BIST(default) "

        echo " 2. TX-ENCODER ENABLED "

        echo " 3. TX-ENCODER DISABLED "

        echo " 4. RX-BIST "

        echo " 5. RX-MODE "

        echo " 6. TX-RX LOOP BACK MODE "

        echo " 7. USER CONFIGURABLE TEST BENCH "

        echo " 8. RUN all modes in the above sequence "

        echo "Enter an Option:"

        set response_modvhdl = $<

        if("$response_modvhdl" == "8") then 

	echo " Do you want the VCD file for all simulations (Y/N) : Default is No"

        set response_dump = $<

        else set response_dump = ""

        endif

        if(("$response_modvhdl" == "2")) then

        ./run_modelsim_vhdl cyp15g0403dxb_tx_ee_tb_all.vhd

        else if(("$response_modvhdl" == "3")) then

        ./run_modelsim_vhdl cyp15g0403dxb_tx_ed_tb_all.vhd

        else if(("$response_modvhdl" == "4")) then

        ./run_modelsim_vhdl cyp15g0403dxb_rx_bist_tb_all.vhd

        else if(("$response_modvhdl" == "5")) then

        ./run_modelsim_vhdl cyp15g0403dxb_rx_tb_all.vhd

        else if(("$response_modvhdl" == "6")) then

         ./run_modelsim_vhdl cyp15g0403dxb_tx_rx_loopback_tb_all.vhd

        else if(("$response_modvhdl" == "7")) then

         ./run_modelsim_vhdl cyp15g0403dxb_user_config_tb_all.vhd

        else if(("$response_modvhdl" == "8")) then

        echo " RUNNING TX-BIST "

        ./run_modelsim_vhdl cyp15g0403dxb_tx_bist_tb_all.vhd $response_modvhdl $response_dump

        echo " RUNNING TX-ENCODER ENABLED "

        ./run_modelsim_vhdl cyp15g0403dxb_tx_ee_tb_all.vhd $response_modvhdl $response_dump

        echo " RUNNING TX-ENCODER DISABLED "

        ./run_modelsim_vhdl cyp15g0403dxb_tx_ed_tb_all.vhd $response_modvhdl $response_dump

        echo " RUNNING RX-BIST "

        ./run_modelsim_vhdl cyp15g0403dxb_rx_bist_tb_all.vhd $response_modvhdl $response_dump

        echo " RUNNING RX-MODE "

        ./run_modelsim_vhdl cyp15g0403dxb_rx_tb_all.vhd $response_modvhdl $response_dump

        echo " RUNNING TX-RX LOOP BACK MODE "

        ./run_modelsim_vhdl cyp15g0403dxb_tx_rx_loopback_tb_all.vhd $response_modvhdl $response_dump

        echo " RUNNING USER CONFIGURABLE TEST BENCH "

        ./run_modelsim_vhdl cyp15g0403dxb_user_config_tb_all.vhd $response_modvhdl $response_dump

        else

	./run_modelsim_vhdl cyp15g0403dxb_tx_bist_tb_all.vhd 

        endif # testbench options if

        echo " BYE! "

        endif

	exit

